/*
 * @Autor: 田甜
 * @Date: 2021-02-08 10:08:45
 */
export default {
    namespaced: true,
    state: {
        // 下拉菜单的数据
        buttonloading: false, //导出loading
        exporturl: "", //成功返回得url
        buttonbool: false, //下载按钮得显隐
        showTagModal: false,
        wsIsConnect: false,
        wxAllData: [],
    },
    getters: {
        /**
         * @description 获取下拉菜单
         * */
        all_wxAllData(state) {
            return state.wxAllData;
        },
    },
    mutations: {
        /**
         * @description 设置下拉菜单数据
         * @param {Object} state vuex state
         * @param {Array} menu menu
         */
        changeWxAllData(state, data) {
            state.wxAllData = data;
        },
        changeWxOne(state, data) {
            let { WeChatId, count } = data;
            let dataA = state.wxAllData;
            dataA.forEach((ee) => {
                if (ee.wechatid === WeChatId) {
                    ee.count = ee.count + count;
                }
            });
            console.log(dataA);
            state.wxAllData = dataA;
        },
        changeLoading(state, data) {
            state.buttonloading = data;
        },
        changebool(state, data) {
            state.buttonbool = data;
        },
        changeUrl(state, data) {
            state.exporturl = data;
        },
        changeShowTagModal(state, data) {
            state.showTagModal = data;
        },
        changeWsIsConnect(state, data) {
            state.wsIsConnect = data;
        },
    },
};
